﻿@using Nop.Core.Domain.Media
@{
    Layout = "~/Views/Shared/_Root.cshtml";
}
@{
    //current category ID
    int currentCategoryId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("category", StringComparison.InvariantCultureIgnoreCase))
    {
        currentCategoryId = Convert.ToInt32(Url.RequestContext.RouteData.Values["categoryId"].ToString());
    }


    //current manufacturer ID
    int currentManufacturerId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("manufacturer", StringComparison.InvariantCultureIgnoreCase))
    {
        currentManufacturerId = Convert.ToInt32(Url.RequestContext.RouteData.Values["manufacturerId"].ToString());
    }
    //current store ID
    int currentStoreId = Nop.Core.Domain.Stores.Store.AllStoreReservedId;
    //if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
    //    Url.RequestContext.RouteData.Values["action"].ToString().Equals("store", StringComparison.InvariantCultureIgnoreCase))
    if (Url.RequestContext.RouteData.Values.ContainsKey("storeId"))
    {
        currentStoreId = Convert.ToInt32(Url.RequestContext.RouteData.Values["storeId"].ToString());
    }

    //current product ID
    int currentProductId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("product", StringComparison.InvariantCultureIgnoreCase))
    {
        currentProductId = Convert.ToInt32(Url.RequestContext.RouteData.Values["productId"].ToString());
    }
}
<div id="sh-main" class="@currentCategoryId columns-two">
    <div class="sh-left-sidebar">
        @if (IsSectionDefined("left"))
        {
            @RenderSection("left")
        }
        else
        {
        <div id="sh-left-menu-block">
        
            @if( currentStoreId > 1 )
                //Store logo
            {
                @Html.Action( "StoreLogo", "Catalog", new { area = "Commerce",  currentStoreId = currentStoreId })
            }
		        <ul id="sh-left-menu-list" class="left-menu-category-list 
                    @if( currentStoreId > 1 ) {<text>store-page</text>}
            ">
                    @Html.Action("CategoryNavigationFront", "Catalog", new { area = "Commerce", currentCategoryId = currentCategoryId, currentProductId = currentProductId, storeId = currentStoreId})
                </ul>

            @if (IsSectionDefined("leftmiddle"))
            {
                @RenderSection("leftmiddle")
            }

        </div>
        }
        <div class="content-float-clear">
        </div>
    </div>
    <div class="sh-content two-column">
        @RenderBody()
    </div>
    <div class="content-float-clear"></div>
</div>